﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:c="clr-namespace:Asdo.Controls">
	
  <!-- Brushes and Colors -->



  <Color x:Key="color-background">#CFD5D9</Color>
  <SolidColorBrush x:Key="brush-background" Color="{StaticResource color-background}" />

  <Color x:Key="color-foreground">#334E69</Color>
  <SolidColorBrush x:Key="brush-foreground" Color="{StaticResource color-foreground}" />

  <Color x:Key="color-border">#002143</Color>
  <SolidColorBrush x:Key="brush-border" Color="{StaticResource color-border}" />

  <LinearGradientBrush x:Key="brush-button-background" EndPoint="0.5,1" StartPoint="0.5,0">
    <GradientStop Color="#FFEAE8E6" Offset="0" />
    <GradientStop Color="#FFD5D2CE" Offset="1" />
  </LinearGradientBrush>

  <LinearGradientBrush x:Key="brush-button-over" EndPoint="0.5,1" StartPoint="0.5,0">
    <GradientStop Color="#FFEAE8E6" Offset="0" />
    <GradientStop Color="#FF988F86" Offset=".6" />
    <GradientStop Color="#FFD5D2CE" Offset="1" />
  </LinearGradientBrush>

  <DrawingBrush Stretch="Fill" x:Key="brush-glass">
    <DrawingBrush.Drawing>
      <DrawingGroup>
        <GeometryDrawing Brush="#33000000">
          <GeometryDrawing.Geometry>
            <RectangleGeometry Rect="0,0,1,1" />
          </GeometryDrawing.Geometry>
        </GeometryDrawing>
        <GeometryDrawing>
          <GeometryDrawing.Geometry>
            <RectangleGeometry Rect="0,0,1,.5" />
          </GeometryDrawing.Geometry>
          <GeometryDrawing.Brush>
            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
              <GradientStop Color="#99FFFFFF" Offset="0" />
              <GradientStop Color="#33FFFFFF" Offset="1" />
            </LinearGradientBrush>
          </GeometryDrawing.Brush>
        </GeometryDrawing>
      </DrawingGroup>
    </DrawingBrush.Drawing>
  </DrawingBrush>

  <Color x:Key="color-pale-gray">#F0F0F6</Color>
  <SolidColorBrush x:Key="brush-pale-gray" Color="{StaticResource color-pale-gray}" />

  <Color x:Key="color-amber">#FFA100</Color>
  <SolidColorBrush x:Key="brush-amber" Color="{StaticResource color-amber}" />

  <Color x:Key="color-bright-blue">#FF0098DB</Color>
  <SolidColorBrush x:Key="brush-bright-blue" Color="{StaticResource color-bright-blue}" />

  <Color x:Key="color-night-blue">#FF00001B</Color>
  <SolidColorBrush x:Key="brush-night-blue" Color="{StaticResource color-night-blue}" />

    <LinearGradientBrush x:Key="brush-bright-blue-gradient" EndPoint="0.5,1" StartPoint="0.5,0">
        <GradientStop Color="{StaticResource color-bright-blue}" Offset="0" />
        <GradientStop Color="{StaticResource color-night-blue}" Offset="1" />
    </LinearGradientBrush>
    
    <LinearGradientBrush x:Key="brush-bright-blue-reverse-gradient" EndPoint="0.5,1" StartPoint="0.5,0">
        <GradientStop Color="{StaticResource color-bright-blue}" Offset="1" />
        <GradientStop Color="{StaticResource color-pale-gray}" Offset="0" />
    </LinearGradientBrush>

    <DrawingBrush Stretch="Fill" x:Key="brush-glow-glass">
    <DrawingBrush.Drawing>
      <DrawingGroup>
        <GeometryDrawing Brush="#33000000">
          <GeometryDrawing.Geometry>
            <RectangleGeometry Rect="0,0,1,1" />
          </GeometryDrawing.Geometry>
        </GeometryDrawing>
        <GeometryDrawing>
          <GeometryDrawing.Geometry>
            <RectangleGeometry Rect="0,0,1,1" />
          </GeometryDrawing.Geometry>
          <GeometryDrawing.Brush>
            <RadialGradientBrush Center="0.5,1" GradientOrigin="0.5,1" RadiusY="2" RadiusX="2">
              <GradientStop Color="{StaticResource color-bright-blue}" />
              <GradientStop Offset="1" />
            </RadialGradientBrush>
          </GeometryDrawing.Brush>
        </GeometryDrawing>
        <GeometryDrawing>
          <GeometryDrawing.Geometry>
            <RectangleGeometry Rect="0,0,1,.5" />
          </GeometryDrawing.Geometry>
          <GeometryDrawing.Brush>
            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
              <GradientStop Color="#99FFFFFF" Offset="0" />
              <GradientStop Color="#33FFFFFF" Offset="1" />
            </LinearGradientBrush>
          </GeometryDrawing.Brush>
        </GeometryDrawing>
      </DrawingGroup>
    </DrawingBrush.Drawing>
  </DrawingBrush>
  <!-- Shapes -->

  <PathGeometry x:Key="path-close"
                Figures="M0,0 H10 L20,10 L30,0 H40 V5 L25,20 L40,35 V40 H30 L20,30 L10,40 H0 V35 L15,20 L0,5 Z" />
  <PathGeometry x:Key="path-left" Figures="M0,0 L5,4 L4,0 L5,-4 Z" />
  <PathGeometry x:Key="path-right" Figures="M0,0 L-5,4 L-4,0 L-5,-4 Z" />
  <PathGeometry x:Key="path-down" Figures="M0,0 L4,5 L8,0 Z" />
  <PathGeometry x:Key="path-gear" FillRule="Nonzero"
                Figures="M417.4375,175.3125C415.02989,193.43332 399.52666,207.4375 380.75,207.4375 362.92746,207.43751 348.02626,194.83997 344.5,178.0625 331.44088,180.8743 318.84697,184.91264 306.8125,190.03125 313.40793,206.8016 306.9498,226.34422 290.875,235.625 275.94954,244.24221 257.48713,241.30618 245.9375,229.5625 237.83753,237.09373 230.29997,245.2531 223.46875,253.96875 237.84984,265.13757 242.1412,285.50684 232.78125,301.71875 223.85405,317.18111 205.44108,323.79183 189.125,318.40625 185.21468,330.42654 182.34593,342.92088 180.65625,355.78125 199.39847,357.60659 214.0625,373.40532 214.0625,392.625 214.06251,410.72976 201.05024,425.78568 183.875,429 185.15295,434.75903 186.63441,440.42917 188.375,446 191.73461,445.11557 195.17011,444.70473 198.5625,444.78125 211.0701,445.06338 223.13542,451.69333 229.84375,463.3125 238.97465,479.1277 235.10741,498.8917 221.5625,510.21875 229.12014,520.16655 237.54107,529.42721 246.71875,537.875 253.6971,529.42178 263.94671,524.67555 274.5,524.4375 281.0516,524.28972 287.69502,525.89236 293.78125,529.40625 310.65672,539.14928 316.95246,560.18646 308.65625,577.46875 320.13081,582.21944 332.10863,585.98823 344.5,588.65625 348.02626,571.87879 362.92747,559.28125 380.75,559.28125 399.52665,559.28122 415.02988,573.28542 417.4375,591.40625 428.65789,589.87676 439.60231,587.48112 450.1875,584.25 444.64994,567.87189 451.23921,549.31695 466.78125,540.34375 472.31419,537.14931 478.34185,535.56029 484.3125,535.40625 496.31646,535.09655 508.09765,540.65934 515.40625,550.90625 526.08052,542.82801 535.96058,533.74407 544.90625,523.8125 532.07538,512.37662 528.57093,493.12185 537.5,477.65625 544.20834,466.03707 556.27365,459.40712 568.78125,459.125 573.77067,459.01246 578.83833,459.91737 583.65625,461.90625 587.97945,451.2025 591.44467,440.05483 593.96875,428.5625 577.87121,424.5391 565.9375,409.9651 565.9375,392.625 565.93753,374.18321 579.44388,358.88357 597.09375,356.0625 594.64514,337.2258 589.69694,319.18039 582.59375,302.25 565.31629,310.52773 544.30075,304.24215 534.5625,287.375 525.45833,271.60611 529.29598,251.9056 542.75,240.5625 534.67325,231.86301 525.87282,223.82594 516.4375,216.59375 505.08123,229.96662 485.44847,233.76905 469.71875,224.6875 454.93528,216.15226 448.25725,198.94231 452.40625,183.1875 441.13116,179.60755 429.44601,176.94925 417.4375,175.3125z M388.875,309.0625C390.15643,309.0625 391.42194,309.09203 392.6875,309.15625 397.7497,309.41333 402.6917,310.18335 407.4375,311.40625 408.62399,311.71175 409.80593,312.04432 410.96875,312.40625 413.2943,313.13061 415.55975,313.96544 417.78125,314.90625 418.89205,315.37634 419.98156,315.88165 421.0625,316.40625 421.60297,316.66855 422.15451,316.94363 422.6875,317.21875 422.762,317.25694 422.8319,317.30531 422.90625,317.34375 423.63125,317.71854 424.35165,318.10228 425.0625,318.5 425.84516,318.93999 426.60919,319.37827 427.375,319.84375 429.41704,321.08578 431.40569,322.41653 433.3125,323.84375 434.0276,324.37865 434.74159,324.94041 435.4375,325.5 435.86498,325.84454 436.29913,326.17751 436.71875,326.53125 437.28531,327.00757 437.82304,327.50731 438.375,328 439.40948,328.92341 440.42694,329.86444 441.40625,330.84375 442.03647,331.47433 442.643,332.12854 443.25,332.78125 443.26011,332.79212 443.27114,332.80162 443.28125,332.8125 443.56193,333.11468 443.84938,333.41194 444.125,333.71875 444.83235,334.50614 445.51411,335.30783 446.1875,336.125 446.37653,336.35439 446.5637,336.58082 446.75,336.8125 447.31135,337.50925 447.86987,338.22042 448.40625,338.9375 449.07464,339.83269 449.71531,340.73053 450.34375,341.65625 451.22165,342.94944 452.07761,344.27517 452.875,345.625 453.32939,346.39358 453.76033,347.18273 454.1875,347.96875 455.33153,350.07385 456.37232,352.21589 457.3125,354.4375 457.72461,355.41063 458.12883,356.381 458.5,357.375 458.53791,357.47648 458.55627,357.58581 458.59375,357.6875 458.92333,358.58213 459.23555,359.49574 459.53125,360.40625 459.57188,360.53129 459.61626,360.65592 459.65625,360.78125 459.7713,361.14207 459.8591,361.5118 459.96875,361.875 460.23805,362.76698 460.5137,363.65671 460.75,364.5625 460.81503,364.81177 460.875,365.06222 460.9375,365.3125 461.09757,365.9526 461.23167,366.60345 461.375,367.25 461.55187,368.04784 461.72404,368.84902 461.875,369.65625 461.88288,369.6984 461.89845,369.73907 461.90625,369.78125 461.91964,369.85357 461.92432,369.92761 461.9375,370 462.10738,370.93277 462.2716,371.86797 462.40625,372.8125 462.41522,372.87547 462.42868,372.93698 462.4375,373 462.46643,373.20674 462.47277,373.41772 462.5,373.625 462.61459,374.49739 462.7285,375.36839 462.8125,376.25 462.91678,377.34564 463.00625,378.45385 463.0625,379.5625 463.12569,380.81791 463.15625,382.10398 463.15625,383.375 463.15625,385.93786 463.03501,388.44124 462.78125,390.9375 462.78021,390.94776 462.78229,390.95849 462.78125,390.96875 462.65491,392.20641 462.49893,393.43728 462.3125,394.65625 462.31095,394.66642 462.31405,394.67733 462.3125,394.6875 462.12558,395.9063 461.90172,397.11391 461.65625,398.3125 461.6542,398.32251 461.6583,398.33374 461.65625,398.34375 461.53327,398.94298 461.39232,399.53127 461.25,400.125 461.11243,400.72006 460.96429,401.31675 460.8125,401.90625 460.80999,401.91603 460.81502,401.92772 460.8125,401.9375 460.50903,403.11408 460.17146,404.28421 459.8125,405.4375 459.80954,405.44703 459.81546,405.45922 459.8125,405.46875 459.09069,407.78456 458.24887,410.06865 457.3125,412.28125 456.37232,414.50286 455.33153,416.6449 454.1875,418.75 454.18311,418.75808 454.19189,418.77317 454.1875,418.78125 453.04705,420.87794 451.79911,422.90634 450.46875,424.875 450.46387,424.88223 450.47364,424.89902 450.46875,424.90625 449.8055,425.887 449.11435,426.8346 448.40625,427.78125 448.40115,427.78807 448.41135,427.80568 448.40625,427.8125 447.69763,428.7592 446.93946,429.68271 446.1875,430.59375 446.18232,430.60003 446.19269,430.61872 446.1875,430.625 443.16276,434.28729 439.78826,437.6639 436.125,440.6875 432.45597,443.71582 428.49121,446.39968 424.28125,448.6875 422.17615,449.83153 420.00286,450.87232 417.78125,451.8125 415.55975,452.75257 413.2943,453.58873 410.96875,454.3125 409.80593,454.67443 408.62399,455.007 407.4375,455.3125 402.6917,456.53437 397.7497,457.30565 392.6875,457.5625 391.42194,457.62672 390.15643,457.65625 388.875,457.65625 387.59357,457.65625 386.32806,457.62672 385.0625,457.5625 380.0003,457.30542 375.0583,456.5354 370.3125,455.3125 369.12601,455.007 367.94407,454.67443 366.78125,454.3125 364.4557,453.58814 362.19025,452.75331 359.96875,451.8125 357.74714,450.87232 355.57385,449.83153 353.46875,448.6875 352.41626,448.11513 351.39602,447.49602 350.375,446.875 349.35398,446.25399 348.33452,445.60384 347.34375,444.9375 346.35569,444.2698 345.39097,443.5882 344.4375,442.875 342.53056,441.44859 340.69674,439.94282 338.9375,438.34375 338.06344,437.54927 337.2103,436.70979 336.375,435.875 335.52908,435.02959 334.71084,434.19768 333.90625,433.3125 333.90098,433.3067 333.91152,433.28705 333.90625,433.28125 333.10679,432.40121 332.31958,431.51149 331.5625,430.59375 330.80535,429.67642 330.05695,428.73472 329.34375,427.78125 328.63061,426.82737 327.94889,425.86345 327.28125,424.875 325.94585,422.89888 324.70653,420.8551 323.5625,418.75 322.41847,416.6449 321.37768,414.50286 320.4375,412.28125 320.43374,412.27237 320.44125,412.25888 320.4375,412.25 319.97122,411.14776 319.50759,410.03483 319.09375,408.90625 319.09037,408.89703 319.09713,408.88423 319.09375,408.875 318.67701,407.73712 318.29938,406.60057 317.9375,405.4375 317.58339,404.29979 317.26909,403.15969 316.96875,402 316.94724,401.91694 316.92747,401.83317 316.90625,401.75 316.6368,400.69436 316.37993,399.60411 316.15625,398.53125 316.10016,398.26161 316.05315,397.98945 316,397.71875 315.8504,396.95819 315.68863,396.20617 315.5625,395.4375 315.49939,395.05252 315.43216,394.6682 315.375,394.28125 315.3705,394.25083 315.37946,394.21793 315.375,394.1875 315.22591,393.17079 315.10726,392.15488 315,391.125 314.98148,390.94734 314.95476,390.77178 314.9375,390.59375 314.83544,389.53998 314.77604,388.47291 314.71875,387.40625 314.71421,387.32183 314.69175,387.24074 314.6875,387.15625 314.62329,385.89064 314.59375,384.62518 314.59375,383.34375 314.59375,382.06232 314.62328,380.79681 314.6875,379.53125 314.74876,378.27824 314.84245,377.02405 314.96875,375.78125 314.9698,375.77093 314.9677,375.76032 314.96875,375.75 315.09456,374.51221 315.25159,373.28161 315.4375,372.0625 315.43906,372.05232 315.43594,372.04143 315.4375,372.03125 315.6239,370.81231 315.84879,369.60498 316.09375,368.40625 316.09579,368.39629 316.09171,368.38496 316.09375,368.375 316.3392,367.1764 316.63502,365.98936 316.9375,364.8125 316.94,364.80278 316.93499,364.79097 316.9375,364.78125 317.24046,363.60452 317.57903,362.4347 317.9375,361.28125 317.94043,361.27182 317.93456,361.25943 317.9375,361.25 318.29938,360.08722 318.67701,358.95004 319.09375,357.8125 319.40601,356.96021 319.75146,356.11861 320.09375,355.28125 320.13263,355.18621 320.17949,355.09483 320.21875,355 320.38701,354.59321 320.54351,354.18437 320.71875,353.78125 320.98901,353.16026 321.27583,352.5495 321.5625,351.9375 321.75888,351.51778 321.95229,351.10291 322.15625,350.6875 322.6055,349.7735 323.07663,348.86279 323.5625,347.96875 323.56682,347.96081 323.55818,347.94544 323.5625,347.9375 324.13445,346.88501 324.72318,345.86477 325.34375,344.84375 325.96883,343.81536 326.60844,342.80738 327.28125,341.8125 327.94411,340.83157 328.63603,339.88434 329.34375,338.9375 329.34863,338.93097 329.33886,338.91278 329.34375,338.90625 330.052,337.95937 330.8109,337.03623 331.5625,336.125 331.56749,336.11895 331.55751,336.0998 331.5625,336.09375 332.31958,335.17649 333.10679,334.2858 333.90625,333.40625 336.30485,330.76738 338.87302,328.3027 341.625,326.03125 345.29403,323.00293 349.25879,320.31907 353.46875,318.03125 355.57385,316.88722 357.74714,315.84643 359.96875,314.90625 362.19025,313.96618 364.4557,313.13002 366.78125,312.40625 367.94407,312.04432 369.12601,311.71175 370.3125,311.40625 375.0583,310.18438 380.0003,309.4131 385.0625,309.15625 386.32806,309.09203 387.59357,309.0625 388.875,309.0625z" />
    

    
  <!-- Styles -->

  <Style TargetType="ButtonBase" x:Key="button">
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="ButtonBase">
          <Border CornerRadius="2" BorderBrush="{TemplateBinding BorderBrush}"
                  Background="{TemplateBinding Background}" BorderThickness="1">

            <ContentPresenter VerticalAlignment="Center" HorizontalAlignment="Center"
                              Margin="{TemplateBinding Padding}" />
          </Border>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
    <Setter Property="BorderBrush" Value="{StaticResource brush-border}" />
    <Setter Property="Background" Value="{StaticResource brush-button-background}" />
    <Setter Property="Foreground" Value="#334E69" />
    <Style.Triggers>
      <Trigger Property="IsEnabled" Value="False">
        <Setter Property="Opacity" Value=".6" />
      </Trigger>
      <Trigger Property="IsMouseOver" Value="True">
        <Setter Property="Background" Value="{StaticResource brush-button-over}" />
      </Trigger>
      <Trigger Property="IsPressed" Value="True">
        <Setter Property="Background" Value="{StaticResource brush-background}" />
      </Trigger>
    </Style.Triggers>
  </Style>

  <c:ThicknessToCornerRadius x:Key="get-radius"></c:ThicknessToCornerRadius>

  <Style TargetType="ButtonBase" x:Key="com-button">
    <Setter Property="BorderBrush" Value="{StaticResource brush-border}" />
    <Setter Property="Background" Value="{StaticResource brush-background}" />
    <Setter Property="Foreground" Value="{StaticResource brush-foreground}" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="ButtonBase">
          <Border Name="bRoot" CornerRadius="{TemplateBinding BorderThickness, Converter={StaticResource get-radius}}"
                  BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" BorderThickness="1">
            <Grid>
              <Border Name="bEffect" CornerRadius="{Binding ElementName=bRoot, Path=CornerRadius}" BorderBrush="White"
                      BorderThickness="1,0,1,1"></Border>
              <Border Name="b" CornerRadius="{Binding ElementName=bRoot, Path=CornerRadius}"
                      Background="{StaticResource brush-glass}">
                <ContentPresenter VerticalAlignment="Stretch" HorizontalAlignment="Stretch"
                                  Margin="{TemplateBinding Padding}" />
              </Border>
            </Grid>
          </Border>
          <ControlTemplate.Triggers>
            <Trigger Property="IsMouseOver" Value="True">
              <Setter TargetName="bEffect" Property="Background">
                <Setter.Value>
                  <RadialGradientBrush Center="0.5,1" GradientOrigin="0.5,1" RadiusY="1" RadiusX="1">
                    <GradientStop Color="#80F0A020" />
                    <GradientStop Offset="1" />
                  </RadialGradientBrush>
                </Setter.Value>
              </Setter>
            </Trigger>
            <Trigger Property="IsPressed" Value="True">
              <Setter TargetName="bEffect" Property="Background" Value="White" />
            </Trigger>
            <Trigger Property="IsEnabled" Value="False">
              <Setter Property="Opacity" Value=".6" />
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>


  <Style TargetType="ButtonBase" BasedOn="{StaticResource button}" x:Key="tab-button">
    <Setter Property="BorderBrush" Value="Transparent" />
    <Setter Property="Background" Value="Transparent" />
    <Style.Triggers>
      <Trigger Property="IsMouseOver" Value="True">
        <Setter Property="BorderBrush" Value="{StaticResource brush-border}" />
        <Setter Property="Background" Value="{StaticResource brush-button-background}" />
      </Trigger>
      <Trigger Property="IsPressed" Value="True">
        <Setter Property="BorderBrush" Value="{StaticResource brush-border}" />
        <Setter Property="Background" Value="{StaticResource brush-background}" />
      </Trigger>
    </Style.Triggers>
  </Style>

  <Style TargetType="TabItem" x:Key="{x:Type TabItem}">
    <Setter Property="Border.BorderThickness" Value="1,1,1,0"></Setter>
    <Setter Property="Padding" Value="10,2"></Setter>
    <Setter Property="BorderBrush" Value="{StaticResource brush-border}" />
    <Setter Property="Panel.ZIndex" Value="0" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="TabItem">
          <Grid>
            <Border Name="back" Opacity=".3" Background="{StaticResource brush-bright-blue-reverse-gradient}" CornerRadius="3,3,0,0" Margin="1,3,0,0" />
            <Border Name="brd" Background="{StaticResource brush-glass}"
                    BorderBrush="{StaticResource brush-night-blue}" BorderThickness="{TemplateBinding Border.BorderThickness}"
                    CornerRadius="3,3,0,0" Margin="0,2,-1,0" Padding="{TemplateBinding Control.Padding}">
              <ContentPresenter RecognizesAccessKey="True" Content="{TemplateBinding HeaderedContentControl.Header}"
                                ContentTemplate="{TemplateBinding HeaderedContentControl.HeaderTemplate}"
                                ContentStringFormat="{TemplateBinding HeaderedContentControl.HeaderStringFormat}" ContentSource="Header"
                                HorizontalAlignment="Stretch" VerticalAlignment="Center"
                                SnapsToDevicePixels="{TemplateBinding UIElement.SnapsToDevicePixels}" />
            </Border>
          </Grid>
          <ControlTemplate.Triggers>
            <Trigger Property="IsSelected" Value="True">
              <Setter TargetName="brd" Property="Margin" Value="0,0,-1,0" />
              <Setter TargetName="back" Property="Margin" Value="1,0,0,0" />
              <Setter TargetName="back" Property="Opacity" Value=".7" />
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
    <Style.Triggers>
      <Trigger Property="IsMouseOver" Value="True"></Trigger>
      <Trigger Property="IsSelected" Value="True">
        <Setter Property="Panel.ZIndex" Value="2" />
      </Trigger>
    </Style.Triggers>
  </Style>

  <Style TargetType="TabControl" x:Key="{x:Type TabControl}">
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate>
          <Grid Background="{TemplateBinding Background}">
            <Grid.RowDefinitions>
              <RowDefinition Height="Auto" />
              <RowDefinition Height="*" />
            </Grid.RowDefinitions>
            <ScrollViewer Name="svSwipe" VerticalScrollBarVisibility="Hidden" HorizontalScrollBarVisibility="Auto" Margin="4,0,0,0">
              <ScrollViewer.Template>
                <ControlTemplate TargetType="ScrollViewer">
                  <Grid>
                    <Grid.ColumnDefinitions>
                      <ColumnDefinition Width="*" />
                      <ColumnDefinition Width="Auto" />
                    </Grid.ColumnDefinitions>
                    <ScrollContentPresenter Grid.Column="0" Margin="{TemplateBinding Control.Padding}"
                                            Content="{TemplateBinding ContentControl.Content}" ContentTemplate="{TemplateBinding ContentControl.ContentTemplate}"
                                            CanContentScroll="{TemplateBinding ScrollViewer.CanContentScroll}" />
                    <StackPanel Grid.Column="1" Orientation="Horizontal" Margin="2,0,0,0"
                                Visibility="{Binding ElementName=svSwipe, Path=ComputedHorizontalScrollBarVisibility}">
                      <RepeatButton Style="{StaticResource com-button}" Command="ScrollBar.LineLeftCommand"
                                    BorderThickness="2">
                        <Path Margin="2,1" Height="16" Width="10" Stroke="{DynamicResource brush-border}"
                              Fill="{DynamicResource brush-background}" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"
                              Data="{StaticResource path-left}" Stretch="UniformToFill" />
                      </RepeatButton>
                      <RepeatButton Margin="-1,0,0,0" Style="{StaticResource com-button}"
                                    Command="ScrollBar.LineRightCommand" BorderThickness="2">
                        <Path Margin="2,1" Height="16" Width="10" Stroke="{DynamicResource brush-border}"
                              Fill="{DynamicResource brush-background}" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"
                              Data="{StaticResource path-right}" Stretch="UniformToFill" />
                      </RepeatButton>
                    </StackPanel>
                  </Grid>
                </ControlTemplate>
              </ScrollViewer.Template>
              <c:SwipePanel x:Name="ItemHost" Background="{TemplateBinding Background}" IsItemsHost="True"
                            Margin="3,1,3,0" HorizontalAlignment="Left" VerticalAlignment="Stretch" Orientation="Horizontal" Panel.ZIndex="1" />

            </ScrollViewer>

            <Border BorderThickness="0,4" Grid.Row="1" CornerRadius="4" BorderBrush="{StaticResource brush-night-blue}">
              <Grid Grid.Row="1" SnapsToDevicePixels="True" Background="AntiqueWhite">
                <ContentPresenter Content="{TemplateBinding TabControl.SelectedContent}"
                                  ContentTemplate="{TemplateBinding TabControl.SelectedContentTemplate}"
                                  ContentStringFormat="{TemplateBinding TabControl.SelectedContentStringFormat}" ContentSource="SelectedContent"
                                  Margin="{TemplateBinding Control.Padding}"
                                  SnapsToDevicePixels="{TemplateBinding UIElement.SnapsToDevicePixels}" />
              </Grid>
            </Border>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <ControlTemplate TargetType="Window" x:Key="template-window">
    <Border BorderBrush="{StaticResource brush-border}" BorderThickness="1" CornerRadius="4"
            Background="{StaticResource brush-background}" Name="pBorder">
      <Grid>
        <Grid.ColumnDefinitions>
          <ColumnDefinition Width="*" />
          <ColumnDefinition Width="Auto" />
        </Grid.ColumnDefinitions>
        <StackPanel Name="pCaption" Margin="4,4,0,0" Orientation="Horizontal" VerticalAlignment="Top" Panel.ZIndex="1">
          <ContentControl Name="bIcon" Width="16" Height="16">
            <Image Source="{TemplateBinding Icon}" Width="16"></Image>
          </ContentControl>
          <TextBlock Name="tCaption" Foreground="Black" Margin="4,0,0,0" FontSize="14" Text="{TemplateBinding Title}">
            <TextBlock.Effect>
              <DropShadowEffect ShadowDepth="3" Opacity=".3" Color="{StaticResource color-border}" />
            </TextBlock.Effect>
          </TextBlock>
        </StackPanel>
        <StackPanel Name="pCommands" Grid.Column="1" Margin="0,-1,4,0" Height="17" VerticalAlignment="Top"
                    Orientation="Horizontal" Panel.ZIndex="1">
          <Button Style="{StaticResource com-button}" Name="bMinimize" Width="27" Margin="0,0,-1,0"
                  CommandParameter="{Binding RelativeSource={RelativeSource TemplatedParent}}" Command="c:WindowSupporter.Minimize"
                  BorderThickness="0,0,0,4" ToolTip="{Binding RelativeSource={RelativeSource Self}, Path=Command.Text}">
            <Border Width="12" Height="4" VerticalAlignment="Bottom" Margin="0,0,0,2"
                    BorderBrush="{StaticResource brush-foreground}" Background="{StaticResource brush-background}" BorderThickness="1" />
          </Button>
          <Button Name="bMaximize" Style="{StaticResource com-button}" Width="27" ToolTip="Maximize"
                  CommandParameter="{Binding RelativeSource={RelativeSource TemplatedParent}}" BorderThickness="0"
                  Command="c:WindowSupporter.Maximize">
            <Border BorderBrush="{StaticResource brush-foreground}" Background="{StaticResource brush-background}"
                    Width="12" Height="10" BorderThickness="1,3,1,1" />
          </Button>
          <Button Name="bClose" Style="{StaticResource com-button}" Width="47" Margin="-1,0,0,0" ToolTip="Close"
                  CommandParameter="{Binding RelativeSource={RelativeSource TemplatedParent}}" BorderThickness="0,0,4,0"
                  Background="#FFf06030" Command="Close">
            <Path Width="12" Height="12" Fill="{StaticResource brush-background}" Data="{StaticResource path-close}"
                  VerticalAlignment="Center" StrokeThickness="1" Stretch="Fill" Stroke="{StaticResource brush-foreground}"
                  HorizontalAlignment="Center" RenderTransformOrigin="0.5,0.5" />
          </Button>
        </StackPanel>
        <AdornerDecorator Panel.ZIndex="0" Grid.ColumnSpan="2">
          <ContentPresenter Content="{TemplateBinding ContentControl.Content}"
                            ContentTemplate="{TemplateBinding ContentControl.ContentTemplate}"
                            ContentStringFormat="{TemplateBinding ContentControl.ContentStringFormat}" />
        </AdornerDecorator>
      </Grid>
    </Border>
    <ControlTemplate.Triggers>
      <Trigger Property="Icon" Value="{x:Null}">
        <Setter TargetName="bIcon" Property="Content">
          <Setter.Value>
            <Border BorderBrush="Black" Background="White" Margin="0,1" BorderThickness="1,3,1,1" />
          </Setter.Value>
        </Setter>
      </Trigger>
      <Trigger Property="IsActive" Value="False">
        <Setter TargetName="pBorder" Property="Background" Value="{StaticResource brush-pale-gray}" />
        <Setter TargetName="tCaption" Property="Opacity" Value="0.4" />
      </Trigger>
      <Trigger Property="WindowState" Value="Maximized">
        <Setter TargetName="pBorder" Property="CornerRadius" Value="0" />
        <Setter TargetName="pBorder" Property="BorderThickness" Value="0" />
      </Trigger>
      <Trigger Property="ResizeMode" Value="NoResize">
        <Setter TargetName="bMinimize" Property="Visibility" Value="Collapsed" />
        <Setter TargetName="bMaximize" Property="Visibility" Value="Collapsed" />
        <Setter TargetName="bClose" Property="BorderThickness" Value="0,0,5,5" />
        <Setter TargetName="bClose" Property="Width" Value="40" />
      </Trigger>
      <Trigger Property="ResizeMode" Value="CanMinimize">
        <Setter TargetName="bMaximize" Property="IsEnabled" Value="False" />
      </Trigger>
      <Trigger Property="WindowState" Value="Maximized">
        <Setter TargetName="bMaximize" Property="ToolTip" Value="Restore Down" />
        <Setter TargetName="bMaximize" Property="Content">
          <Setter.Value>
            <Grid>
              <Border BorderBrush="{StaticResource brush-foreground}" Background="{StaticResource brush-background}"
                      Margin="3,0,0,3" Width="10" Height="8" BorderThickness="1,2,1,1" />
              <Border BorderBrush="{StaticResource brush-foreground}" Background="{StaticResource brush-background}"
                      Width="10" Height="8" BorderThickness="1,2,1,1" Margin="0,3,3,0" />
            </Grid>
          </Setter.Value>
        </Setter>
      </Trigger>
    </ControlTemplate.Triggers>
  </ControlTemplate>

  <Style TargetType="Window" x:Key="Window">
    <Setter Property="AllowsTransparency" Value="True" />
    <Setter Property="Background" Value="Transparent" />
    <Setter Property="WindowStyle" Value="None" />
    <Setter Property="SnapsToDevicePixels" Value="True" />
    <Setter Property="Template" Value="{StaticResource template-window}" />
  </Style>

  <Style TargetType="Window" x:Key="captionless-window">
    <Setter Property="AllowsTransparency" Value="True" />
    <Setter Property="Background" Value="Transparent" />
    <Setter Property="WindowStyle" Value="None" />
    <Setter Property="SnapsToDevicePixels" Value="True" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="Window">
          <Border BorderBrush="{StaticResource brush-border}" BorderThickness="1" CornerRadius="4"
                  Background="{StaticResource brush-background}" Name="pBorder">
            <Grid>
              <AdornerDecorator Panel.ZIndex="0" Grid.ColumnSpan="2">
                <ContentPresenter Content="{TemplateBinding ContentControl.Content}"
                                  ContentTemplate="{TemplateBinding ContentControl.ContentTemplate}"
                                  ContentStringFormat="{TemplateBinding ContentControl.ContentStringFormat}" />
              </AdornerDecorator>
            </Grid>
          </Border>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>


</ResourceDictionary>